package com.fangshi

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.fangshi.databinding.ActivityMainBinding
import androidx.databinding.DataBindingUtil.setContentView

class MainActivity : AppCompatActivity() {
    var appReady = false
    override fun onCreate(savedInstanceState: Bundle?) {
        val splashscreen = installSplashScreen()
        super.onCreate(savedInstanceState)
        Handler(Looper.getMainLooper())
            .postDelayed({ appReady = true }, 1000)
        splashscreen.setKeepOnScreenCondition { !appReady }
        setContentView<ActivityMainBinding>(this, R.layout.activity_main)
    }
}